package com.ethink.order.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.order.api.info.GroupMateDetailInfo;
import com.ethink.order.common.entity.GroupMateDetail;

/**
 * 组套商品明细表 Converter转换器
 *
 * @author default
 * @date 2023-02-22
 */
@Component
public class GroupMateDetailConverter implements Converter<GroupMateDetailInfo, GroupMateDetail> {

    @Override
    public GroupMateDetail convertTo(GroupMateDetailInfo info) {
        if(info == null) {
            return null;
        }
        GroupMateDetail entity = new GroupMateDetail ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public GroupMateDetailInfo convertFrom(GroupMateDetail entity) {
        if(entity == null) {
            return null;
        }
        GroupMateDetailInfo info = new GroupMateDetailInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
